package cn.trasen.his.poc.std.api.pmodel;

import cn.trasen.his.poc.std.api.emums.*;
import cn.trasen.his.poc.std.api.model.major.WardBed;
import pro.shushi.pamirs.boot.base.model.ServerAction;
import pro.shushi.pamirs.boot.base.ux.annotation.field.UxWidget;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxDetail;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxForm;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxTable;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxTableSearch;
import pro.shushi.pamirs.meta.annotation.Field;
import pro.shushi.pamirs.meta.annotation.Model;
import pro.shushi.pamirs.meta.enmu.ModelTypeEnum;
import pro.shushi.pamirs.meta.enmu.NullableBoolEnum;

import java.util.Date;
import java.util.List;

/**
 * Bed
 *
 * @author lian on2024/12/07 14:14.
 */
// 模型中UX开头的注解(UxForm/UxTable/UxDetail等)可以不用写，都可在设计器中进行可视化配置; 代码里面写这些注解是为了默认页面的交互
@UxForm(grid = 3)
@UxDetail(grid = 3)
@Model.model(WardBedCardProxy.MODEL_MODEL)
@Model(displayName = "床头卡")
@Model.Advanced(type = ModelTypeEnum.PROXY)
public class WardBedCardProxy extends WardBed {
    public static final String MODEL_MODEL = "ts.his.WardBedCardProxy";

    @Field.String
    @Field(displayName = "患者姓名")
    private String patientName;

    @Field.Enum
    @Field(displayName = "性别")
    private SexTypeEnum sex;

    @Field.String
    // 默认的表单页面不显示(都可以通过界面设计器配置，这里主要是默认页面交互，不去设计器拖页面)
    @UxForm.FieldWidget(@UxWidget(invisible = "true"))
    //显示类型的字段是前端需要，因为不需要在DB中建字段
    @Field(displayName = "性别显示", store = NullableBoolEnum.FALSE)
    private String sexDisName;

    @Field.String
    @Field(displayName = "年龄")
    private String age;

    @Field.String
    @Field(displayName = "科室名称", required = true)
    private String deptName;

    @Field.String
    @Field(displayName = "住院号", required = true)
    private String visitNo;

    @Field.Date
    @Field(displayName = "入院时间", invisible = true)
    private Date inDate;

    @Field.Date
    @Field(displayName = "出院时间", invisible = true)
    private Date outDate;

    @Field.Date
    @Field(displayName = "入区时间")
    private Date inAreaDate;

    @Field.String
    @Field(displayName = "管床医生ID", invisible = true)
    private String bedDocId;

    @Field.String
    @Field(displayName = "管床医生")
    private String bedDocName;

    @Field.Enum
    @UxForm.FieldWidget(@UxWidget(invisible = "true"))
    @Field(displayName = "患者状态", defaultValue = "SIGN_NEW_IN_HOSP")
    private InpatientStatusEnum status;

    @Field.String
    @UxForm.FieldWidget(@UxWidget(invisible = "true"))
    @Field(displayName = "患者状态显示", store = NullableBoolEnum.FALSE)
    private String statusDisName;

    @Field.String
    @Field(displayName = "管床护士")
    private String nurseName;

    @Field.Enum
    @Field(displayName = "护理级别", required = true)
    private InpatientTendLevelEnum tendLevel;

    @Field.String
    @UxForm.FieldWidget(@UxWidget(invisible = "true"))
    @Field(displayName = "护理级别显示", store = NullableBoolEnum.FALSE)
    private String tendLevelDisName;

    @Field.Integer
    @Field(displayName = "危急值")
    private Long danger;

    @Field.Text
    @UxForm.FieldWidget(@UxWidget(span = 3))
    @UxDetail.FieldWidget(@UxWidget(span = 3))
    @Field(displayName = "诊断")
    private String curDiagnosisName;

    @Field.Integer
    @Field(displayName = "天数")
    private Long inDays;

    @Field.Enum
    @Field(displayName = "床头标签", multi = true)
    private List<InpatientLabelEnum> inpatientLabel;

    @Field.String
    // 默认的表单页面不显示(都可以通过界面设计器配置，这里主要是默认页面交互，不去设计器拖页面)
    @UxForm.FieldWidget(@UxWidget(invisible = "true"))
    //显示类型的字段是前端需要，因为不需要在DB中建字段
    @Field(displayName = "床头标签显示", store = NullableBoolEnum.FALSE)
    private List<String> inpatientLabelDisName;

    @Field.Enum
    @Field(displayName = "床位卡模式")
    private CardStatusEnum cardStatus;

    @Field.String
    @UxForm.FieldWidget(@UxWidget(invisible = "true"))
    @Field(displayName = "床位卡模式显示", store = NullableBoolEnum.FALSE)
    private String cardStatusDisName;

    // OK
    @UxTableSearch.FieldWidget(@UxWidget())
    @Field.Enum
    @Field(displayName = "在院状态")
    private InHospitalStatusEnum inHospitalStatus;

    @Field.String
    @UxForm.FieldWidget(@UxWidget(invisible = "true"))
    @Field(displayName = "在院状态显示", store = NullableBoolEnum.FALSE)
    private String inHospitalStatusDisName;

    // OK
    @Field.Enum
    @Field(displayName = "病人状态")
    private PatBedCardStatusEnum patBedCardStatus;

    @Field.String
    @UxForm.FieldWidget(@UxWidget(invisible = "true"))
    @Field(displayName = "病人状态显示", store = NullableBoolEnum.FALSE)
    private String patBedCardStatusDisName;

    // OK
    @Field.Enum
    @Field(displayName = "人员分类")
    private PersonClassEnum personClass;

    @Field.String
    @UxForm.FieldWidget(@UxWidget(invisible = "true"))
    @Field(displayName = "人员分类显示", store = NullableBoolEnum.FALSE)
    private String personClassDisName;

    // 模型中UX开头的注解(UxForm/UxTable/UxDetail等)都可以不用写，都可在设计器中进行可视化配置; 代码里面写这些注解是为了默认页面的交互
    @UxForm.FieldWidget(@UxWidget(widget = "UploadImg", invisible = "true"))
    @UxTable.FieldWidget(@UxWidget(widget = "UploadImg"))
    @UxDetail.FieldWidget(@UxWidget(widget = "UploadImg"))
    @Field.String(size = 256)
    @Field(displayName = "人员图像", store = NullableBoolEnum.FALSE)
    private String personLogo;

    @Field.one2many
    @Field(displayName = "操作元素", store = NullableBoolEnum.FALSE, invisible = true)
    private List<ServerAction> operateElement;

    @Field.String
    @Field(displayName = "操作对应的显示名称", store = NullableBoolEnum.FALSE, multi = true, invisible = true)
    private List<String> operateDisNames;

}
